﻿@namespace Microsoft.FluentUI.AspNetCore.Components
@inherits FluentComponentBase

@if (Visible)
{
    <FluentStack Orientation="Orientation.Horizontal"
                 HorizontalAlignment="@(Dialog.Instance?.Parameters?.Alignment == HorizontalAlignment.Center ? HorizontalAlignment.Right : HorizontalAlignment.Left)"
                 VerticalAlignment="VerticalAlignment.Bottom"
                 Style="@StyleValue"
                 Class="@ClassValue"
                 Id="@Id">
        @if (ChildContent == null)
        {
            @if (Dialog.Instance?.Parameters?.ShowPrimaryAction == true)
            {
                <FluentButton Title="@Dialog.Instance?.Parameters?.PrimaryAction"
                              OnClick="@OnPrimaryActionButtonClickAsync"
                              Appearance="Appearance.Accent"
                              Disabled="@(Dialog.Instance?.Parameters?.PrimaryActionEnabled == false)">
                    @Dialog.Instance?.Parameters?.PrimaryAction
                </FluentButton>
            }
            @if (Dialog.Instance?.Parameters?.ShowSecondaryAction == true)
            {
                <FluentButton Title="@Dialog.Instance?.Parameters?.SecondaryAction"
                              OnClick="@OnSecondaryActionButtonClickAsync"
                              Appearance="Appearance.Neutral"
                              Disabled="@(Dialog.Instance?.Parameters?.SecondaryActionEnabled == false)">
                    @Dialog.Instance?.Parameters?.SecondaryAction
                </FluentButton>
            }
        }
        else
        {
            @ChildContent
        }
    </FluentStack>
}